package com.itheima.Service;

import com.itheima.dao.addDao;
import com.itheima.domain.Student;
import org.apache.commons.beanutils.BeanUtils;

import java.lang.reflect.InvocationTargetException;
import java.util.Map;

public class addService  {

    public static void saveStudent(Map<String, String[]> parameterMap) {
        Student student = new Student();
        try {
            BeanUtils.populate(student,parameterMap);
            addDao.saveStudent(student);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
